/*
 * @Author: humengchuan 531537052@qq.com
 * @Date: 2024-11-21 18:06:00
 * @LastEditors: humengchuan 531537052@qq.com
 * @LastEditTime: 2024-11-25 19:44:02
 * @FilePath: \project-my\forum-project\models\user.js
 * @Description: 用户数据模型
 */
const seq = require('../config/seq')

const User = seq.define('user', {
  userName: {
    type: seq.STRING,
    allowNull: false,
    unique: true,
    comment: '用户名'
  },
  password: {
    type: seq.STRING,
    allowNull: false,
    comment: '密码'
  },
  email: {
    type: seq.STRING,
    unique: true,
    comment: '邮箱'
  },
  gender: {
    type: seq.BOOLEAN,
    allowNull: false,
    defaultValue: 1,
    comment: '性别 0:女 1:男 2:保密'
  },
  nickName: {
    type: seq.STRING,
    comment: '昵称'
  },
  pictrue: {
    type: seq.STRING,
    comment: '头像'
  },
  age: {
    type: seq.INTEGER,
    comment: '年龄'
  },
  city: {
    type: seq.STRING,
    comment: '城市'
  },
  isAdmin: {
    type: seq.BOOLEAN,
    defaultValue: false,
  }
})

module.exports = User